package com.qd.panda.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 我的消息
 *
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("panda_user_msg")
public class UserMsg extends Model<UserMsg> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "msg_id", type = IdType.ASSIGN_ID)
    private String msgId;
    /**
     * 消息内容
     */
    @TableField("note")
    private String note;
    /**
     * 添加时间
     */
    @TableField("add_time")
    private LocalDateTime addTime;
    /**
     * 业务ID
     */
    @TableField("bid")
    private String bid;
    /**
     * 是否已读:0未读1已读
     */
    @TableField("can_read")
    private Integer canRead;
    /**
     * 消息类型
     */
    @TableField("msg_type")
    private String msgType;
    /**
     * 用户ID
     */
    @TableField("user_id")
    private String userId;

    public void freeData() {
        this.msgId = null;
        this.note = null;
        this.addTime = null;
        this.bid = null;
        this.canRead = null;
        this.msgType = null;
        this.userId = null;
    }

}
